<?php
set_include_path(get_include_path() . PATH_SEPARATOR. LIB_PATH . PATH_SEPARATOR . ROOT_PATH.'/models');

class Loader
{
	private static $__classes = array();
	
	static function load($className)
	{
		if(class_exists($className)) {
			return;
		}
		
		if(!isset(self::$__classes[$className])) {
			self::$__classes[$className] =  @require_once str_replace('_', '/', $className) . '.php';
		} else {
			return self::$__classes[$className];	
		}
	
	}
}

/**
 * 注册一个自动载入处理函数
 */
spl_autoload_register(array('loader', 'load'));

